Ext.define('appmod.view.knowledge.usergroup.UserAssignForm', {
    extend: 'Ext.form.Panel',
    alias: [
		'widget.knowledge.usergroup.userassignform' ,
		'widget.knowledge-usergroup-userassignform'
	],
	region : 'center',
	bodyPadding: 10,
	requires: [
		'Ext.ux.form.ItemSelector'
	],

	constructor: function (config) {
		
		if (config.fieldStores) {
			this.fieldStores = config.fieldStores;
		}
        this.callParent(arguments);
     },	
	
    initComponent: function() {
        var me = this;

	  	var fieldStores = me.fieldStores;
		var dsUser = null;
		try {
			dsUser = fieldStores['dsUser'];
		} catch (e) {
			Ext.log({
				msg : '[appmod.view.knowledge.usergroup.UserAssignForm]' + e,
				level:'error'
			});
		}		
        
        Ext.applyIf(me, {
            items: [
				{
					xtype: 'hiddenfield',
					name: 'id'
				},			
                {
                    xtype: 'displayfield',
					labelWidth: 60,
                    fieldLabel: '组名称',
					name:'groupName',
                    anchor: '95%'
                }
				,
                {
		            xtype: 'itemselector',
		            name: 'members',
		            anchor: '95%',
		            labelWidth: 60,
					fieldLabel: '组成员',
		            imagePath: '../../js/ux/images/',
		            store: dsUser,
					height: 200,
		            displayField: 'name',
		            valueField: 'id',
		            allowBlank: false,
		            msgTarget: 'side',
		            fromTitle: '可选成员',
		            toTitle: '已选成员'
		        }
			
            ]
        });
        
        me.callParent(arguments);
    }
});